import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";

Vue.use(VueRouter);

const routes = [{
    path: "/",
    // name属性应具有唯一性
    name: "Home",
    component: Home,
  },
  {
    path: "/my",
    name: "My",
    component: () =>
      import( "../views/My.vue")
  },
  {
    path: "/search",
    name: "Search",
    component: () =>
      import( "../views/Search.vue")
  },
  {
    path: "/dingdan",
    name: "Dingdan",
    component: () =>
      import( "../views/Dingdan.vue")
  },
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes
});


export default router;